/**
 * 根据屏幕宽度，返回对应的分辨率
 * @param width {string}
 * @return {string}
 */
export function getResolutionByWidth(width) {
    const resolutions = {
        1920: "1920x1080",
        1366: "1366x768",
        1280: "1280x768",
        1024: "1024x768",
        800: "800x600",
        768: "768x1280"
        // "720": "720x1280",
        // "640": "640x480",
        // "480": "480x800",
        // "400": "400x240",
        // "320": "320x240",
        // "240": "240x320"
    };

    // 修改小于号为大于号
    for (const key in resolutions) {
        if (+width <= Number(key)) {
            return resolutions[key];
        }
    }
    return "1920x1080";
}
